package extras.mak001;

import org.rsbuddy.tabs.Inventory;

import com.rsbuddy.script.task.LoopTask;

import extras.salvation.api.methods.InventoryCache;

public class PickUpStats extends LoopTask {

	private static int[] lootIDs;
	private static int[] inventory = new int[0];

	@Override
	public int loop() {
		for (int p = 0; p < lootIDs.length; p++) {
			if (Inventory.contains(lootIDs[p])) {
				if (InventoryCache.getCount(true, lootIDs[p]) != Inventory
						.getCount(true, lootIDs[p])) {
					int c = Inventory.getCount(true, lootIDs[p])
							- InventoryCache.getCount(true, lootIDs[p]);
					inventory[p] = +c;
					InventoryCache.update();
				}
			}
		}
		return 0;
	}

	public static int[] getCounts() {
		return inventory;
	}
	
	public static void setLoot(int[] ids){
		lootIDs = ids;
		inventory = new int[ids.length];
	}

}
